/*
 * @@-COPYRIGHT-START-@@
 *
 * Copyright (c) 2017 Qualcomm Innovation Center, Inc.
 * All Rights Reserved.
 * Confidential and Proprietary - Qualcomm Innovation Center, Inc.
 *
 * @@-COPYRIGHT-END-@@
 */

#ifndef _ATH_PARAMETER_API__
#define _ATH_PARAMETER_API_

//#define NETLINK_PARAMETER_EVENT NETLINK_USERSOCK
//#define PARMETER_GROUP          0x22
#define IEEE80211_ADDR_LEN      6
#define MAX_SSID_LEN            32

#define PAPI_GENL_FAMILY_NAME   "PAPINL"
#define PAPI_GENL_MCGRP         "PAPINL_MCGRP"
#define PAPI_GENL_VERSION       1

/* attributes */
enum {
    PAPI_ATTR_UNSPEC,
    PAPI_ATTR_EVENT,
    PAPI_ATTR_TEST,
    __PAPI_ATTR_MAX
};
#define PAPI_ATTR_MAX (__PAPI_ATTR_MAX - 1)

/* commands */
enum {
    PAPI_CMD_UNSPEC,
    PAPI_CMD_EVENT,
    PAPI_CMD_TEST,
    __PAPI_CMD_MAX
};
#define PAPI_CMD_MAX (__PAPI_CMD_MAX - 1)

/*
 * Parameter API report types
 */
typedef enum {
    PAPI_ASSOCIATED_STA_REPORT = 1,
    PAPI_NON_ASSOCIATED_STA_REPORT = 2,
} PAPI_REPORT_TYPE;

/*
 * Associated station events
 */
typedef enum {
    PAPI_STA_ASSOCIATION = 0,
    PAPI_STA_DISASSOCIATION = 1,
    PAPI_STA_NEIGHBOR_REPORT_REQUEST = 2,
} PAPI_STA_EVENT;

/*
 * Parameter API report types
 */
typedef enum {
    PAPI_BAND_24_GHZ = 0,
    PAPI_BAND_5_GHZ = 1,
} PAPI_BAND;

/*
 * Meta data about associated stations
 */
struct papi_associated_sta_report_ind {
    u_int8_t mac[IEEE80211_ADDR_LEN];
    u_int32_t time_stamp;
    u_int32_t sta_event;
};

/*
 * Meta data about non-associated stations
 */
struct papi_non_associated_sta_report_ind {
    u_int8_t mac[IEEE80211_ADDR_LEN];
    u_int32_t time_stamp;
    u_int8_t ssid[MAX_SSID_LEN + 1];
    u_int8_t ssid_len;
    u_int8_t band;
    u_int8_t chan_num;
    int8_t rssi;
};

typedef struct ath_netlink_papi_event {
    /* Type of the report: One of PAPI_REPORT_TYPE.*/
    u_int32_t type;
    /* The OS-specific index of the VAP on which the event occurred.*/
    u_int32_t sys_index;
    /* Data for the event. Which memeber is valid is based on
       type field.*/
    union {
        struct papi_associated_sta_report_ind associated_sta_report;
        struct papi_non_associated_sta_report_ind non_associated_sta_report;
    } data;
} ath_netlink_papi_event_t;

/*
 * Event types asynchronoulsy generated by parameter api
 * module.
 */
typedef enum {
    /* Indication that station associated */
    ATH_EVENT_PAPI_STA_ASSOCIATED,
    /* Indication that station disassociated */
    ATH_EVENT_PAPI_STA_DISASSOCIATED,
    /* Indication that neighbor report request received */
    ATH_EVENT_PAPI_NEIGHBOR_REPORT_REQUEST,
    /* Indication that probe request was received */
    ATH_EVENT_PAPI_PROBE_REQEUST,
} ATH_PAPI_EVENT;

#endif /* _ATH_PARAMETER_API__ */
